package com.cavy.platform.server.domain.job;

import com.cavy.platform.server.domain.ContainerInfo;
import com.cavy.platform.server.domain.Stage;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
 * @author 唐旭
 * @Date 2018/7/24
 */
@Data
public class JobStage {
    protected String name;
    protected List<JobContainer> containerList = new ArrayList<>();
    private JobStageStatus status = JobStageStatus.UN_EXECUTED;

    public JobStage() {
    }

    public JobStage(Stage stage) {
        this.name = stage.getName();
        for (ContainerInfo info : stage.getContainerList()) {
            containerList.add(new JobContainer(info));
        }
    }
}
